﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Web;

namespace Cms.Web.Framework.Infrastructure.Wrappers
{
    public class CmsIdentity : ICmsIdentity
    {
        public string Name
        {
            get
            {
                if (HttpContext.Current.User != null && HttpContext.Current.User.Identity != null)
                {
                    return HttpContext.Current.User.Identity.Name;
                }
                return null;
            }
        }

        public bool IsAuthenticated
        {
            get
            {
                if (HttpContext.Current.User != null && HttpContext.Current.User.Identity != null && HttpContext.Current.User.Identity.IsAuthenticated)
                {
                    return true;
                }
                return false;
            }
        }

        public bool NoCurrentUser
        {
            get { return HttpContext.Current.User == null; }
        }
    }
}
